﻿//------------------------------------------------------------------------------
// System Name:   Customer Service Platform
// Component:     CIS  Overseas CustomerDefinitionHelper
// Created By:    Samara Jiang (samaraj@wicresoft.com)
// Created Date:  2011-2-10
//------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ASBCC.Database.EntityFramework;

namespace ASBCC.Business.CIS
{
    /// <summary>
    /// CustomerDefinition bussiness Helper
    /// </summary>
    public static class CustomerDefinitionHelper
    {
        /// <summary>
        /// 将一个CustomerDefinition的激活状态设为未激活
        /// </summary>
        public static void SetDefinitionInfoDisabled(int defID)
        {
            using (var dc = new CCEntities())
            {
                dc.Definitions.FirstOrDefault(p => p.DefID == defID).Disabled = true;
                dc.SaveChanges();
            }
        }
        /// <summary>
        /// 根据当前ID获取Name
        /// </summary>
        public static IEnumerable getName(int entityID)
        {
            using (var dc = new CCEntities())
            {
                var name = dc.Definitions.FirstOrDefault(p => p.DefID == entityID).Name;
                return name;
            }
        }

    }
}
